using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;

namespace Microsoft.SharedSource.SqlServer.MDDE.ManagementStudio
{
    internal partial class UpgradeTemplateBase : Form
    {
        protected UpgradeTemplateWizardController controller;
        internal event EventHandler HelpClick;
        internal event EventHandler BackClick;
        internal event EventHandler NextClick;
        internal event EventHandler FinishClick;
        internal event EventHandler CancelClick;

        protected string HeaderBoldText
        {
            get { return this.lblHeaderBoldText.Text; }
            set { this.lblHeaderBoldText.Text = value; }
        }

        protected string HeaderRegularText
        {
            get { return this.lblHeaderNormalText.Text; }
            set { this.lblHeaderNormalText.Text = value; }
        }

        /// <summary>
        /// Had to keep this constructor otherwise the designer craps out for derived classes.
        /// </summary>
        internal UpgradeTemplateBase()
        {
            InitializeComponent();
        }

        internal UpgradeTemplateBase(UpgradeTemplateWizardController controller)
        {
            InitializeComponent();
            this.controller = controller;

            // Initialize the handlers.
            this.btnHelp.Click += new EventHandler(btnHelp_Click);
            this.btnBack.Click += new EventHandler(btnBack_Click);
            this.btnNext.Click += new EventHandler(btnNext_Click);
            this.btnFinish.Click += new EventHandler(btnFinish_Click);
            this.btnCancel.Click += new EventHandler(btnCancel_Click);
        }

        protected virtual void btnCancel_Click(object sender, EventArgs e)
        {
            if (CancelClick != null)
                CancelClick(this, e);
        }

        void btnFinish_Click(object sender, EventArgs e)
        {
            if (FinishClick != null)
                FinishClick(this, e);
        }

        protected virtual void btnNext_Click(object sender, EventArgs e)
        {
            if (NextClick != null)
                NextClick(this, e);
        }

        protected virtual void btnBack_Click(object sender, EventArgs e)
        {
            if (BackClick != null)
                BackClick(this, e);
        }

        void btnHelp_Click(object sender, EventArgs e)
        {
            if (HelpClick != null)
                HelpClick(this, e);
        }
    }
}